<?php  
namespace Common\Model;
use Think\Model;
class UserModel extends Model{
	protected $tablename="user";
	protected $patchValidate=true;
	protected $_validate=array(
				array("user_name",'require','用户名不能为空'),
				array("user_truename",'require','真实姓名不能为空'),
				array('user_name','','用户名已被占用','1','unique'),
				array('user_password','/^\S{6,20}$/','密码不符合规范','1','regex'),
				array('repassword','user_password','两次密码不一致','1','confirm'),
				array('user_emali','/^\w+@\w+\.(\w{2,3}|(\w{3}\.\w{2}))$/','邮箱不符合规范'),
				array('user_phone','/^13[0-9]{1}[0-9]{8}$|15[0189]{1}[0-9]{8}$|188[0-9]{8}$/','手机号不符合规范','1','regex'),
				array('user_sex',array(0,1),'性别不合规范','1','in')
	);
}
